home *** CD-ROM | disk | FTP | other *** search
Wrap
SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) NNNNAAAAMMMMEEEE streambuf - interface for derived classes SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_iiii_oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh_>>>> _tttt_yyyy_pppp_eeee_dddd_eeee_ffff _llll_oooo_nnnn_gggg _ssss_tttt_rrrr_eeee_aaaa_mmmm_oooo_ffff_ffff_,,,, _ssss_tttt_rrrr_eeee_aaaa_mmmm_pppp_oooo_ssss_;;;; _cccc_llll_aaaa_ssss_ssss _iiii_oooo_ssss _{{{{ _pppp_uuuu_bbbb_llll_iiii_cccc_:::: _eeee_nnnn_uuuu_mmmm _ssss_eeee_eeee_kkkk______dddd_iiii_rrrr _{{{{ _bbbb_eeee_gggg_,,,, _cccc_uuuu_rrrr_,,,, _eeee_nnnn_dddd _}}}}_;;;; _eeee_nnnn_uuuu_mmmm _oooo_pppp_eeee_nnnn______mmmm_oooo_dddd_eeee _{{{{ _iiii_nnnn_,,,, _oooo_uuuu_tttt_,,,, _aaaa_tttt_eeee_,,,, _aaaa_pppp_pppp_,,,, _tttt_rrrr_uuuu_nnnn_cccc_,,,, _nnnn_oooo_cccc_rrrr_eeee_aaaa_tttt_eeee_,,,, _nnnn_oooo_rrrr_eeee_pppp_llll_aaaa_cccc_eeee _}}}} _;;;; _////_//// _aaaa_nnnn_dddd _llll_oooo_tttt_ssss _oooo_ffff _oooo_tttt_hhhh_eeee_rrrr _ssss_tttt_uuuu_ffff_ffff_,,,, _ssss_eeee_eeee _iiii_oooo_ssss_((((_3333_CCCC_++++_++++_)))) _...._...._.... _}}}} _;;;; _cccc_llll_aaaa_ssss_ssss _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff _{{{{ _pppp_uuuu_bbbb_llll_iiii_cccc_:::: _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_((((_)))) _;;;; _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_((((_cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_eeee_nnnn_))))_;;;; _vvvv_oooo_iiii_dddd _dddd_bbbb_pppp_((((_)))) _;;;; _pppp_rrrr_oooo_tttt_eeee_cccc_tttt_eeee_dddd_:::: _iiii_nnnn_tttt _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _bbbb_aaaa_ssss_eeee_((((_))))_;;;; _iiii_nnnn_tttt _bbbb_llll_eeee_nnnn_((((_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _eeee_bbbb_aaaa_cccc_kkkk_((((_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _eeee_bbbb_uuuu_ffff_((((_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _eeee_gggg_pppp_tttt_rrrr_((((_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _eeee_pppp_pppp_tttt_rrrr_((((_))))_;;;; _vvvv_oooo_iiii_dddd _gggg_bbbb_uuuu_mmmm_pppp_((((_iiii_nnnn_tttt _nnnn_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _gggg_pppp_tttt_rrrr_((((_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _pppp_bbbb_aaaa_ssss_eeee_((((_))))_;;;; _vvvv_oooo_iiii_dddd _pppp_bbbb_uuuu_mmmm_pppp_((((_iiii_nnnn_tttt _nnnn_))))_;;;; _cccc_hhhh_aaaa_rrrr_**** _pppp_pppp_tttt_rrrr_((((_))))_;;;; _vvvv_oooo_iiii_dddd _ssss_eeee_tttt_gggg_((((_cccc_hhhh_aaaa_rrrr_**** _eeee_bbbb_,,,, _cccc_hhhh_aaaa_rrrr_**** _gggg_,,,, _cccc_hhhh_aaaa_rrrr_**** _eeee_gggg_))))_;;;; _vvvv_oooo_iiii_dddd _ssss_eeee_tttt_pppp_((((_cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _cccc_hhhh_aaaa_rrrr_**** _eeee_pppp_))))_;;;; _vvvv_oooo_iiii_dddd _ssss_eeee_tttt_bbbb_((((_cccc_hhhh_aaaa_rrrr_**** _bbbb_,,,, _cccc_hhhh_aaaa_rrrr_**** _eeee_bbbb_,,,, _iiii_nnnn_tttt _aaaa_====_0000_))))_;;;; _iiii_nnnn_tttt _uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_))))_;;;; _vvvv_oooo_iiii_dddd _uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_iiii_nnnn_tttt_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _iiii_nnnn_tttt _dddd_oooo_aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _~~~~_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_((((_)))) _;;;; _pppp_uuuu_bbbb_llll_iiii_cccc_:::: _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _iiii_nnnn_tttt_pppp_bbbb_aaaa_cccc_kkkk_ffff_aaaa_iiii_llll_((((_iiii_nnnn_tttt _cccc_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _iiii_nnnn_tttt_oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_iiii_nnnn_tttt _cccc_====_EEEE_OOOO_FFFF_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _iiii_nnnn_tttt_uuuu_nnnn_dddd_eeee_rrrr_ffff_llll_oooo_wwww_((((_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_**** _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_eeee_nnnn_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _ssss_tttt_rrrr_eeee_aaaa_mmmm_pppp_oooo_ssss _ssss_eeee_eeee_kkkk_pppp_oooo_ssss_((((_ssss_tttt_rrrr_eeee_aaaa_mmmm_pppp_oooo_ssss_,,,, _iiii_nnnn_tttt _====_iiii_oooo_ssss_::::_::::_iiii_nnnn_||||_iiii_oooo_ssss_::::_oooo_uuuu_tttt_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _ssss_tttt_rrrr_eeee_aaaa_mmmm_pppp_oooo_ssss _ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_ssss_tttt_rrrr_eeee_aaaa_mmmm_oooo_ffff_ffff_,,,, _ssss_eeee_eeee_kkkk______dddd_iiii_rrrr_,,,, _iiii_nnnn_tttt _====_iiii_oooo_ssss_::::_::::_iiii_nnnn_||||_iiii_oooo_ssss_::::_oooo_uuuu_tttt_))))_;;;; _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _iiii_nnnn_tttt_ssss_yyyy_nnnn_cccc_((((_))))_;;;; _}}}}_;;;; PPPPaaaaggggeeee 1111 SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffffs implement the buffer abstraction described in _ssss_bbbb_uuuu_ffff_...._pppp_uuuu_bbbb(3C++). However, the _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff class itself contains only basic members for manipulating the characters and normally a class derived from _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff will be used. This man page describes the interface needed by programmers who are coding a derived class. Broadly speaking there are two kinds of member functions described here. The non-virtual functions are provided for manipulating a _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff in ways that are appropriate in a derived class. Their descriptions reveal details of the implementation that would be inappropriate in the public interface. The virtual functions permit the derived class to specialize the _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff class in ways appropriate to the specific sources and sinks that it is implementing. The descriptions of the virtual functions explain the obligations of the virtuals of the derived class. If the virtuals behave as specified, the _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff will behave as specified in the public interface. However, if the virtuals do not behave as specified, then the _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff may not behave properly, and an _iiii_oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm (or any other code) that relies on proper behavior of the _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff may not behave properly either. In the following descriptions assume: - _s_b is a _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_****. - _i and _n are _iiii_nnnn_tttts. - _p_t_r, _b, _e_b, _p, _e_p, _e_b, _g, and _e_g are _cccc_hhhh_aaaa_rrrr_****s. - _c is an _iiii_nnnn_tttt character (positive or _EEEE_OOOO_FFFF)). - _p_o_s is a _ssss_tttt_rrrr_eeee_aaaa_mmmm_pppp_oooo_ssss. (See _ssss_bbbb_uuuu_ffff_...._pppp_uuuu_bbbb(3C++).) - _o_f_f is a _ssss_tttt_rrrr_eeee_aaaa_mmmm_oooo_ffff_ffff. - _d_i_r is a _ssss_eeee_eeee_kkkk_dddd_iiii_rrrr. - _m_o_d_e is an _iiii_nnnn_tttt representing an _oooo_pppp_eeee_nnnn______mmmm_oooo_dddd_eeee. CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss:::: _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_((((_)))) Constructs an empty buffer corresponding to an empty sequence. _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_((((_b_,,,,_l_e_n_)))) Constructs an empty buffer and then sets up the reserve area to be the _l_e_n bytes starting at _b. TTTThhhheeee GGGGeeeetttt,,,, PPPPuuuutttt,,,, aaaannnndddd RRRReeeesssseeeerrrrvvvveeeerrrr aaaarrrreeeeaaaa The protected members of _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff present an interface to derived classes organized around three areas (arrays of bytes) managed cooperatively by the base and derived classes. They are the _g_e_t _a_r_e_a, the _p_u_t _a_r_e_a, and the _r_e_s_e_r_v_e _a_r_e_a (or buffer). The get and the put areas are normally disjoint, but they may both overlap the reserve area, whose primary purpose is to be a resource in which space for the put and get areas can be allocated. The get and the put areas are changed as characters are put into and gotten from the buffer, but the reserve area normally remains fixed. The areas are defined by a collection of _cccc_hhhh_aaaa_rrrr_**** values. The buffer abstraction is described in terms of pointers that point between characters, but the _cccc_hhhh_aaaa_rrrr_**** values must point at _cccc_hhhh_aaaa_rrrrs. To establish a correspondence the _cccc_hhhh_aaaa_rrrr_**** values should be thought of as pointing just before the byte they really point at. PPPPaaaaggggeeee 2222 SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) FFFFuuuunnnnccccttttiiiioooonnnnssss ttttoooo eeeexxxxaaaammmmiiiinnnneeee tttthhhheeee ppppooooiiiinnnntttteeeerrrrssss _p_t_r_====_s_b_----_>>>>_bbbb_aaaa_ssss_eeee_((((_)))) Returns a pointer to the first byte of the reserve area. Space between _s_b_----_>>>>_bbbb_aaaa_ssss_eeee_((((_)))) and _s_b_----_>>>>_eeee_bbbb_uuuu_ffff_((((_)))) is the reserve area. _p_t_r_====_s_b_----_>>>>_eeee_bbbb_aaaa_cccc_kkkk_((((_)))) Returns a pointer to a lower bound on _s_b_----_>>>>_gggg_pppp_tttt_rrrr_((((_)))). Space between _s_b_----_>>>>_eeee_bbbb_aaaa_cccc_kkkk_((((_)))) and _s_b_----_>>>>_gggg_pppp_tttt_rrrr_((((_)))) is available for putback. _p_t_r_====_s_b_----_>>>>_eeee_bbbb_uuuu_ffff_((((_)))) Returns a pointer to the byte after the last byte of the reserve area. _p_t_r_====_s_b_----_>>>>_eeee_gggg_pppp_tttt_rrrr_((((_)))) Returns a pointer to the byte after the last byte of the get area. _p_t_r_====_s_b_----_>>>>_eeee_pppp_pppp_tttt_rrrr_((((_)))) Returns a pointer to the byte after the last byte of the put area. _p_t_r_====_s_b_----_>>>>_gggg_pppp_tttt_rrrr_((((_)))) Returns a pointer to the first byte of the get area. The available characters are those between _s_b_----_>>>>_gggg_pppp_tttt_rrrr_((((_)))) and _s_b_----_>>>>_eeee_gggg_pppp_tttt_rrrr_((((_)))). The next character fetched will be _****_s_b_----_>>>>_gggg_pppp_tttt_rrrr_((((_))))_)))) unless _s_b_----_>>>>_eeee_gggg_pppp_tttt_rrrr_((((_)))) is less than or equal to _s_b_----_>>>>_gggg_pppp_tttt_rrrr_((((_)))). _p_t_r_====_s_b_----_>>>>_pppp_bbbb_aaaa_ssss_eeee_((((_)))) Returns a pointer to the put area base. Characters between _s_b_----_>>>>_pppp_bbbb_aaaa_ssss_eeee_((((_)))) and _s_b_----_>>>>_pppp_pppp_tttt_rrrr_((((_)))) have been stored into the buffer and not yet consumed. _p_t_r_====_s_b_----_>>>>_pppp_pppp_tttt_rrrr_((((_)))) Returns a pointer to the first byte of the put area. The space between _ssss_bbbb_----_>>>>_pppp_pppp_tttt_rrrr_((((_)))) and _ssss_bbbb_----_>>>>_eeee_pppp_pppp_tttt_rrrr_((((_)))) is the put area and characters will be stored here. FFFFuuuunnnnccccttttiiiioooonnnnssss ffffoooorrrr sssseeeettttttttiiiinnnngggg tttthhhheeee ppppooooiiiinnnntttteeeerrrrssss Note that to indicate that a particular area (get, put, or reserve) does not exist, all the associated pointers should be set to zero. _s_b_----_>>>>_ssss_eeee_tttt_bbbb_((((_b_,,,, _e_b_,,,, _i_)))) Sets _bbbb_aaaa_ssss_eeee_((((_)))) and _eeee_bbbb_uuuu_ffff_((((_)))) to _b and _e_b respectively. _i controls whether the area will be subject to automatic deletion. If _i is non-zero, then _b will be deleted when _bbbb_aaaa_ssss_eeee is changed by another call of _ssss_eeee_tttt_bbbb_((((_)))), or when the destructor is called for _****_s_b. If _b and _e_b are both null then we say that there is no reserve area. If _b is non-null, there is a reserve area even if _e_b is less than _b and so the reserve area has zero length. PPPPaaaaggggeeee 3333 SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) _s_b_----_>>>>_ssss_eeee_tttt_pppp_((((_p_,,,, _e_p_)))) Sets _pppp_pppp_tttt_rrrr_((((_)))) to _p, _pppp_bbbb_aaaa_ssss_eeee_((((_)))) to _p, and _eeee_pppp_pppp_tttt_rrrr_((((_)))) to _e_p. _s_b_----_>>>>_ssss_eeee_tttt_gggg_((((_e_b_,,,, _g_,,,, _e_g_)))) Sets _eeee_bbbb_aaaa_cccc_kkkk_((((_)))) to _e_b, _gggg_pppp_tttt_rrrr_((((_)))) to _g, and _eeee_gggg_pppp_tttt_rrrr_((((_)))) to _e_g. OOOOtttthhhheeeerrrr nnnnoooonnnn----vvvviiiirrrrttttuuuuaaaallll mmmmeeeemmmmbbbbeeeerrrrssss _i_====_s_b_----_>>>>_aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) Tries to set up a reserve area. If a reserve area already exists or if _s_b_----_>>>>_uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_)))) is nonzero, _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) returns 0 without doing anything. If the attempt to allocate space fails, _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) returns _EEEE_OOOO_FFFF, otherwise (allocation succeeds) _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) returns 1. _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) is not called by any non- virtual member function of _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff. _i_====_s_b_----_>>>>_bbbb_llll_eeee_nnnn_((((_)))) Returns the size (in _cccc_hhhh_aaaa_rrrrs) of the current reserve area. _dddd_bbbb_pppp_((((_)))) Writes directly on file descriptor 1 information in ASCII about the state of the buffer. It is intended for debugging and nothing is specified about the form of the output. It is considered part of the protected interface because the information it prints can only be understood in relation to that interface, but it is a public function so that it can be called anywhere during debugging. _s_b_----_>>>>_gggg_bbbb_uuuu_mmmm_pppp_((((_n_)))) Increments _gggg_pppp_tttt_rrrr_((((_)))) by _n which may be positive or negative. No checks are made on whether the new value of _gggg_pppp_tttt_rrrr_((((_)))) is in bounds. _s_b_----_>>>>_pppp_bbbb_uuuu_mmmm_pppp_((((_n_)))) Increments _pppp_pppp_tttt_rrrr_((((_)))) by _n which may be positive or negative. No checks are made on whether the new value of _pppp_pppp_tttt_rrrr_((((_)))) is in bounds. _s_b_----_>>>>_uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_iiii_)))) _i_====_s_b_----_>>>>_uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_)))) There is a private variable known as _s_b's buffering state. _s_b_----_>>>>_uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_i_)))) sets the value of this variable to _i and _s_b_---- _>>>>_uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_)))) returns the current value. This state is independent of the actual allocation of a reserve area. Its primary purpose is to control whether a reserve area is allocated automatically by _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee. VVVViiiirrrrttttuuuuaaaallll mmmmeeeemmmmbbbbeeeerrrr ffffuuuunnnnccccttttiiiioooonnnnssss Virtual functions may be redefined in derived classes to specialize the behavior of _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffffs. This section describes the behavior that these virtual functions should have in any derived classes; the next section describes the behavior that these functions are defined to have in base class _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff. PPPPaaaaggggeeee 4444 SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) _i_====_s_b_----_>>>>_dddd_oooo_aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) Is called when _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) determines that space is needed. _dddd_oooo_aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) is required to call _ssss_eeee_tttt_bbbb_((((_)))) to provide a reserve area or to return _EEEE_OOOO_FFFF if it cannot. It is only called if _s_b_----_>>>>_uuuu_nnnn_bbbb_uuuu_ffff_ffff_eeee_rrrr_eeee_dddd_((((_)))) is zero and _s_b_----_>>>>_bbbb_aaaa_ssss_eeee_((((_)))) is zero. _i_====_oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_c_)))) Is called to consume characters. If _c is not _EEEE_OOOO_FFFF, _oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) also must either save _c or consume it. Usually it is called when the put area is full and an attempt is being made to store a new character, but it can be called at other times. The normal action is to consume the characters between _pppp_bbbb_aaaa_ssss_eeee_((((_)))) and _pppp_pppp_tttt_rrrr_((((_)))), call _ssss_eeee_tttt_pppp_((((_)))) to establish a new put area, and if _c_!!!!_====_EEEE_OOOO_FFFF store it (using _ssss_pppp_uuuu_tttt_cccc_((((_))))). _s_b_----_>>>>_oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) should return _EEEE_OOOO_FFFF to indicate an error; otherwise it should return something else. _i_====_s_b_----_>>>>_pppp_bbbb_aaaa_cccc_kkkk_ffff_aaaa_iiii_llll_((((_c_)))) Is called when _eeee_bbbb_aaaa_cccc_kkkk_((((_)))) equals _gggg_pppp_tttt_rrrr_((((_)))) and an attempt has been made to putback _c. If this situation can be dealt with (e.g., by repositioning an external file), _pppp_bbbb_aaaa_cccc_kkkk_ffff_aaaa_iiii_llll_((((_)))) should return _c; otherwise it should return _EEEE_OOOO_FFFF. _p_o_s_====_s_b_----_>>>>_ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_o_f_f_,,,, _d_i_r_,,,, _m_o_d_e_)))) Repositions the get and/or put pointers (i.e., the abstract get and put pointers, not _pppp_pppp_tttt_rrrr_((((_)))) and _gggg_pppp_tttt_rrrr_((((_))))). The meanings of _o_f_f and _d_i_r are discussed in _ssss_bbbb_uuuu_ffff_...._pppp_uuuu_bbbb(3C++). _m_o_d_e specifies whether the put pointer (_iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt bit set) or the get pointer (_iiii_oooo_ssss_::::_::::_iiii_nnnn bit set) is to be modified. Both bits may be set in which case both pointers should be affected. A class derived from _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff is not required to support repositioning. _ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_)))) should return _EEEE_OOOO_FFFF if the class does not support repositioning. If the class does support repositioning, _ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_)))) should return the new position or _EEEE_OOOO_FFFF on error. _p_o_s_====_s_b_----_>>>>_ssss_eeee_eeee_kkkk_pppp_oooo_ssss_((((_p_o_s_,,,, _m_o_d_e_)))) Repositions the _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff get and/or put pointer to _p_o_s. _m_o_d_e specifies which pointers are affected as for _ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_)))). Returns _p_o_s (the argument) or _EEEE_OOOO_FFFF if the class does not support repositioning or an error occurs. _s_b_====_s_b_----_>>>>_ssss_eeee_tttt_bbbb_uuuu_ffff_((((_p_t_r_,,,, _l_e_n_)))) Offers the array at _p_t_r with _l_e_n bytes to be used as a reserve area. The normal interpretation is that if _p_t_r or _l_e_n are zero then this is a request to make the _s_b unbuffered. The derived class may use this area or not as it chooses. It may accept or ignore the request for unbuffered state as it chooses. _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_)))) should return _s_b if it honors the request. Otherwise it should return 0. _iiii_====_s_b_----_>>>>_ssss_yyyy_nnnn_cccc_((((_)))) Is called to give the derived class a chance to look at the state of the areas, and synchronize them with any external PPPPaaaaggggeeee 5555 SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) representation. Normally _ssss_yyyy_nnnn_cccc_((((_)))) should consume any characters that have been stored into the put area, and if possible give back to the source any characters in the get area that have not been fetched. When _ssss_yyyy_nnnn_cccc_((((_)))) returns there should not be any unconsumed characters, and the get area should be empty. _ssss_yyyy_nnnn_cccc_((((_)))) should return _EEEE_OOOO_FFFF if some kind of failure occurs. _i_====_s_b_----_>>>>_uuuu_nnnn_dddd_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) Is called to supply characters for fetching, i.e., to create a condition in which the get area is not empty. If it is called when there are characters in the get area it should return the first character. If the get area is empty, it should create a nonempty get area and return the next character (which it should also leave in the get area). If there are no more characters available, _uuuu_nnnn_dddd_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) should return _EEEE_OOOO_FFFF and leave an empty get area. The default definitions of the virtual functions: _i_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_dddd_oooo_aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_((((_)))) Attempts to allocate a reserve area using _oooo_pppp_eeee_rrrr_aaaa_tttt_oooo_rrrr _nnnn_eeee_wwww. _i_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_c_)))) Is compatible with the old stream package, but that behavior is not considered part of the specification of the iostream package. Therefore, _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) should be treated as if it had undefined behavior. That is, derived classes should always define it. _i_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_pppp_bbbb_aaaa_cccc_kkkk_ffff_aaaa_iiii_llll_((((_c_)))) Returns _EEEE_OOOO_FFFF. _p_o_s_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_ssss_eeee_eeee_kkkk_pppp_oooo_ssss_((((_p_o_s_,,,, _m_o_d_e_)))) Returns _s_b_----_>>>>_ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_ssss_tttt_rrrr_eeee_aaaa_mmmm_oooo_ffff_ffff_((((_p_o_s_))))_,,,,_iiii_oooo_ssss_::::_::::_bbbb_eeee_gggg_,,,,_m_o_d_e_)))). Thus to define seeking in a derived class, it is frequently only necessary to define _ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_)))) and use the inherited _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_ssss_eeee_eeee_kkkk_pppp_oooo_ssss_((((_)))). _p_o_s_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_ssss_eeee_eeee_kkkk_oooo_ffff_ffff_((((_o_f_f_,,,, _d_i_r_,,,, _m_o_d_e_)))) Returns _EEEE_OOOO_FFFF. _s_b_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_ssss_eeee_tttt_bbbb_uuuu_ffff_((((_p_t_r_,,,, _l_e_n_)))) Will honor the request when there is no reserve area. _i_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_ssss_yyyy_nnnn_cccc_((((_)))) Returns 0 if the get area is empty and there are no unconsumed characters. Otherwise it returns _EEEE_OOOO_FFFF. _iiii_====_s_b_----_>>>>_ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_uuuu_nnnn_dddd_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) Is compatible with the old stream package, but that behavior is not considered part of the specification of the iostream package. Therefore, _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_::::_::::_uuuu_nnnn_dddd_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) should be treated PPPPaaaaggggeeee 6666 SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) SSSSBBBBUUUUFFFF....PPPPRRRROOOOTTTT((((3333CCCC++++++++)))) as if it had undefined behavior. That is, it should always be defined in derived classes. CCCCAAAAVVVVEEEEAAAATTTTSSSS The constructors are public for compatibility with the old stream package. They ought to be protected. The interface for unbuffered actions is awkward. It's hard to write _uuuu_nnnn_dddd_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) and _oooo_vvvv_eeee_rrrr_ffff_llll_oooo_wwww_((((_)))) virtuals that behave properly for unbuffered _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_((((_))))s without special casing. Also there is no way for the virtuals to react sensibly to multi-character gets or puts. Although the public interface to _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffffs deals in characters and bytes, the interface to derived classes deals in _cccc_hhhh_aaaa_rrrrs. Since a decision had to be made on the types of the real data pointers, it seemed easier to reflect that choice in the types of the protected members than to duplicate all the members with both plain and unsigned char versions. But perhaps all these uses of _cccc_hhhh_aaaa_rrrr_**** ought to have been with a typedef. The implementation contains a variant of _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_)))) that accepts a third argument. It is present only for compatibility with the old stream package. SSSSEEEEEEEE AAAALLLLSSSSOOOO _ssss_bbbb_uuuu_ffff_...._pppp_uuuu_bbbb(3C++), _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff(3C++), _iiii_oooo_ssss(3C++) _iiii_ssss_tttt_rrrr_eeee_aaaa_mmmm(3C++) _oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm(3C++) PPPPaaaaggggeeee 7777